home *** CD-ROM | disk | FTP | other *** search
- Path: newsroom.hitc.com!usenet
- From: psand@eos.hitc.com (G. Patrick Sand)
- Newsgroups: gnu.g++.help,comp.lang.c++
- Subject: Re: IS THIS LEGAL? Static method returns pointer to class
- Date: 6 Mar 1996 19:56:37 GMT
- Organization: Hughes Aircraft (EOSDIS)
- Message-ID: <4hkqll$o96@newsroom.hitc.com>
- References: <4hdu70$efa@panix.com> <Dnt85t.FGu@doc.ntu.ac.uk>
- NNTP-Posting-Host: 155.157.118.56
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- In article <Dnt85t.FGu@doc.ntu.ac.uk>, pt3chaj says...
- [SNIP!!]
- > 17 static Triangle *makeinstance(Param &);
- [snip!--a smaller snip ;-))
-
- Drop the * before the function name--what you have here is a pointer to a
- function (which is itself a pointer...)
-
- It should work fine if you just define it at:
-
- static Triangle makeinstance(Param &);
-
- I've used static functions to create objects, especially singletons, a la
- Design Patterns--Gamma, et al.
-
- Works like a charm...
- --
- G. Patrick Sand
- psand@eos.hitc.com
- PatSand@aol.com
- (301) 925-0791
- "Travel Light But Right..."
- Microsoft Network is prohibited from redistributing
- this work in any form, in whole or in part. License
- to distribute this individual post is available to Microsoft
- for $999. Posting without permission constitutes an
- agreement to these terms...gps
-
-